function updateRole() {
//    var selected = $("#roleTable").bootstrapTable('getSelections');
    var selected = $("#roleTable").bootstrapTreeTable("getSelections");
    var selected_length = selected.length;
    if (!selected_length) {
        $MB.n_warning($MB.i18n('tips.edit.role'));
        return;
    }
    if (selected_length > 1) {
        $MB.n_warning($MB.i18n('tips.edit.role.msg'));
        return;
    }
    var roleId = selected[0].id;
    $.post(ctx + "role/getRole", {"roleId": roleId}, function (r) {
        if (r.code === 0) {
            var $form = $('#role-add');
            var $roleTree = $('#roleTree');
            var $menuTree = $('#menuTree');
            $form.modal();
            var role = r.msg;
            $("#role-add-modal-title").html($MB.i18n('role.update'));
            $form.find("input[name='roleName']").val(role.roleName);
            $form.find("input[name='oldRoleName']").val(role.roleName);
            $form.find("input[name='roleId']").val(role.roleId);
            $form.find("input[name='remark']").val(role.remark);
            $roleTree.jstree('select_node', role.parentId, true);
            $roleTree.jstree('disable_node', role.roleId);
//          var menuArr = []; [edit start] jinhui.li 20181218
            for (var i = 0; i < role.menuIds.length; i++) {
//                menuArr.push(role.menuIds[i]);
            	if(!$menuTree.jstree('is_parent', role.menuIds[i])){
            		$menuTree.jstree('select_node', role.menuIds[i], true);
            	} 
            }
//            $menuTree.jstree('select_node', menuArr, true);[edit end] jinhui.li 20181218
            $menuTree.jstree().close_all();
            $("#role-add-button").attr("name", "update");
        } else {
            $MB.n_danger(r.msg);
        }
    });
}